package model.semantics.binary;

import model.semantics.BinaryOperation;


/**
 * Raises the absolute value of the left to the power of right.
 * The absolute value is taken so you don't get imaginary numbers.
 * 
 * @author Anne Weng
 */
public class Exponentiate extends BinaryOperation
{
	protected boolean leftAssociative = true;
	
	public Exponentiate(int precedence)
	{
		super(precedence);
	}
	
    @Override
    protected double evaluateValue (double left, double right)
    {
        return Math.pow(Math.abs(left), right);
    }
}
